#ifndef __PACKET_FILTER__
#define __PACKET_FILTER__

using namespace std;
#include <string>
#include <pcap.h>
#include <vector>
#include <packet_quer.h>

class PacketFilter
{
 public:
    PacketFilter(PacketQuer *quer,
            vector<string>& devices, 
            string filter_string = "") throw (const char *);
    PacketFilter(PacketQuer *quer, string filter_string = "") 
        throw (const char *);
    ~PacketFilter();
    int setFiletrString(string);   
    
    void startFiltering();
    void getPackets();
   
private:
    string _filter_string;
    string _netdev;
    bool _started_filtering;    
    std::vector <pcap_t *> _handles;
    PacketQuer *_quer;
};

#endif 
